package com.zhiliao.mybatis.mapper;

import com.zhiliao.mybatis.model.TSysLog;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Description:
 *
 * @author qirong
 * @date 2018-10-26
 */
public interface TSysLogMapper {

    /**
     * deleteByPrimaryKey
     * @param id
     * @return
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * insert
     * @param record
     * @return
     */
    int insert(TSysLog record);

    /**
     * selectByPrimaryKey
     * @param id
     * @return
     */
    TSysLog selectByPrimaryKey(Integer id);

    /**
     * selectAll
     * @return
     */
    List<TSysLog> selectAll();

    /**
     * selectByStartDate
     * @param startDate
     * @return
     */
    @Select("select * from t_sys_log where createTime>=#{starDate} order by id desc")
    List<TSysLog> selectByStartDate(String startDate);

    /**
     * selectByEndDate
     * @param endDate
     * @return
     */
    @Select("select * from t_sys_log where createTime<=#{endDate} order by id desc")
    List<TSysLog> selectByEndDate(String endDate);

    /**
     * selectByDate
     * @param starDate
     * @param endTime
     * @return
     */
    @Select("select * from t_sys_log where  createTime>=#{starDate} and createTime<=#{endDate} order by id desc")
    List<TSysLog> selectByDate(@Param("starDate") String starDate,@Param("endDate") String endTime);

    /**
     * updateByPrimaryKey
     * @param record
     * @return
     */
    int updateByPrimaryKey(TSysLog record);
}